<?php
/**
 * Created by PhpStorm.
 * User: baiyang
 * Date: 16-7-14
 * Time: 下午6:14
 *
 */
//引入数据库及其操作
require_once("clSqlOperation.php");
require_once ("clJson.php");
class clMyInfo extends clJson
{
    private $arData;

    function __construct($requestJson)
    {
        parent::__construct($requestJson);
        $this->arData = parent::fnGetJson();
    }

    /**
     * @return array
     *function:获取用户信息
     *parament:
     */
    function fnGetInfo()
    {
        $result = null;
        if ($this->arData['user_phone'] != null) {
            $query = new clSqlOperation("*", "user_info", "user_phone = $this->arData['user_phone']", null);
            $result = $query->fnGetOne();
        } elseif ($this->arData['user_qq_id'] != null) {
            $query = new clSqlOperation("*", "user_info", "user_qq_id = $this->arData['user_qq_id']", null);
            $result = $query->fnGetOne();
        } elseif ($this->arData['user_wechat_id'] != null) {
            $query = new clSqlOperation("*", "user_info", "user_wechat_id = $this->arData['user_wechat_id']", null);
            $result = $query->fnGetOne();
        } else {
            $result = "传输值错误，请重新传输！";
        }
        return $result;
    }
}